package ten;

public class 十五lambda {
    static class Like2 implements Ilike{
        @Override
        public void lambda() {
            System.out.println("I like lambda02!");
        }
    }
    public static void main(String[] args) {
        Ilike like = new Like();
        like.lambda();

        like = new Like2();
        like.lambda();

        like = new Ilike() {
            @Override
            public void lambda() {
                System.out.println("I like lambda03!");
            }
        };
        like.lambda();

        like = ()-> System.out.println("I like lambda04!");
        like.lambda();
    }
}

interface Ilike{
    void lambda();
}

class Like implements Ilike{
    @Override
    public void lambda() {
        System.out.println("I like lambda01!");
    }
}
